/**
* All Rights Reserved , Copyright (C) 2021 , 青岛鼎信通讯股份有限公司
*
* MmsProvinceMarketingInfoServiceAuto
* 省区行销配置信息表新
*
* 修改纪录
* 2021-07-08 版本：1.0 lvzhijun 创建。
* @version 版本：1.0
* @author 作者：lvzhijun
* 创建日期：2021-07-08
*/

package com.topscomm.mms.service.impl.auto;

import javax.annotation.Resource;
import com.topscomm.basic.IBasicDao;
import com.topscomm.tap.common.DatacodeCache;
import java.util.Map;
import com.topscomm.mms.*;
import com.topscomm.mms.pojo.MmsProvinceMarketingInfoEntity;
import com.topscomm.mms.dao.IMmsProvinceMarketingInfoDao;


public class MmsProvinceMarketingInfoServiceAuto extends MmsService<MmsProvinceMarketingInfoEntity,IMmsProvinceMarketingInfoDao> {

	/**
	 * @author: lvzhijun
	 * @date: 2021-07-08
	 * @param mapRow
	 * @description:设置字段显示值
	 * @modify: 2021-7-26 modified Marketingpost.toString().trim()
	 */
	@Override
	public void setDispFields(Map<String, Object> mapRow, DatacodeCache datacodeCache) {
		String temp;
		if (mapRow.get("deptcommoncode1") != null) {
			temp = mapRow.get("deptcommoncode1").toString();
			mapRow.put("dispdeptcommoncode1", datacodeCache.getValueDynamic("DeptCommonCodeTrack", temp, "code", "name"));
		}
		if (mapRow.get("marketingpost") != null) {
			//此处需要Trim()去掉字符串空格
			temp = mapRow.get("marketingpost").toString().trim();
			mapRow.put("dispmarketingpost", datacodeCache.getValueDynamic("MmsMarketingPost", temp, "code", "name"));
		}
		if (mapRow.get("postusercodes") != null) {
			temp = mapRow.get("postusercodes").toString();
			mapRow.put("disppostusercodes", datacodeCache.getValueDynamic("CboUser", temp, "code", "code"));
		}
		if (mapRow.get("productline") != null) {
			temp = mapRow.get("productline").toString();
			mapRow.put("dispproductline", datacodeCache.getValueDynamic("PostDeptCommonCode", temp, "code", "name"));
		}
		if (mapRow.get("enabled") != null) {
			temp = mapRow.get("enabled").toString();
			mapRow.put("dispenabled", datacodeCache.getValueDynamic("CboYesNo", temp, "code", "name"));
		}
	}

	@Override
	@Resource(name = "mmsProvinceMarketingInfoDao")
	public void setDao(IBasicDao<MmsProvinceMarketingInfoEntity> dao) {
		super.setDao(dao);
	}
}
